package net.uhuijia.shop.info.controller;


import net.uhuijia.appbase.controller.BaseController;
import net.uhuijia.shop.info.persistence.model.Shop;
import net.uhuijia.shop.info.persistence.model.ShopExample;
import net.uhuijia.shop.info.service.ShopService;
import net.uhuijia.vo.shop.ShopBaseDetaiVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value="/client/shop")
public class ShopClientController extends BaseController<ShopService,Shop,ShopExample> {

    @Autowired
    private ShopService shopService;
    /**
     * @Author xzj
     * @Description //获取店铺基本信息
     * @Date  2018/10/6
     * @Param
     * @return
     **/
    @RequestMapping(value = "/baseDetail/{shopId}")
    @ResponseBody
    public ShopBaseDetaiVo getShopBaseDetaiVo(@PathVariable("shopId") String shopId){
        if(StringUtils.isEmpty(shopId))
            throw new IllegalArgumentException();
        ShopBaseDetaiVo shopBaseDetaiVo = this.shopService.getShopBaseDetaiVoByShopId(shopId);
        return shopBaseDetaiVo;
    }

}
